<!-- HTML header for doxygen 1.9.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CMSIS-Driver: Sample Use of Storage Driver</title>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="tabs.js"></script>
<script type="text/javascript" src="footer.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<script type="text/javascript" src="darkmode_toggle.js"></script>
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
<link href="extra_navtree.css" rel="stylesheet" type="text/css"/>
<link href="extra_search.css" rel="stylesheet" type="text/css"/>
<link href="extra_tabs.css" rel="stylesheet" type="text/css"/>
<link href="version.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../version.js"></script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 55px;">
  <td id="projectlogo" style="padding: 1.5em;"><img alt="Logo" src="cmsis_logo_white_small.png"/></td>
  <td style="padding-left: 1em; padding-bottom: 1em;padding-top: 1em;">
   <div id="projectname">CMSIS-Driver
   &#160;<span id="projectnumber"><script type="text/javascript">
     <!--
     writeHeader.call(this);
     writeVersionDropdown.call(this, "CMSIS-Driver");
     //-->
    </script>
   </span>
   </div>
   <div id="projectbrief">Peripheral Interface for Middleware and Application Code</div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
  <!--END !PROJECT_NAME-->
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
  <ul class="tablist">
    <script type="text/javascript">
      writeComponentTabs.call(this);
    </script>
  </ul>
</div>
<script type="text/javascript">
  writeSubComponentTabs.call(this);
</script>
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__SampleUseOfStorageDriver.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">Sample Use of Storage Driver<div class="ingroups"><a class="el" href="group__storage__interface__gr.html">Storage Interface</a></div></div></div>
</div><!--header-->
<div class="contents">
<p><b>Example Code:</b></p>
<p>The following is a generic algorithm to erase and program one <a class="el" href="group__storage__interface__gr.html#aac21d3f798c9fcad415b99cf4157935a">ARM_STORAGE_BLOCK_ATTRIBUTES::erase_unit</a> worth of storage and then read it back to be verified. It handles both synchronous and asynchronous driver implementations.</p>
<div class="fragment"><div class="line"><span class="comment">// Copyright (c) 2006-2016, Arm Limited, All Rights Reserved</span></div>
<div class="line"><span class="comment">// SPDX-License-Identifier: Apache-2.0</span></div>
<div class="line"><span class="comment">//</span></div>
<div class="line"><span class="comment">// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may</span></div>
<div class="line"><span class="comment">// not use this file except in compliance with the License.</span></div>
<div class="line"><span class="comment">// You may obtain a copy of the License at</span></div>
<div class="line"><span class="comment">//</span></div>
<div class="line"><span class="comment">// https://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><span class="comment">//</span></div>
<div class="line"><span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><span class="comment">// distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT</span></div>
<div class="line"><span class="comment">// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><span class="comment">// See the License for the specific language governing permissions and</span></div>
<div class="line"><span class="comment">// limitations under the License.</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="Driver__Storage_8h.html">Driver_Storage.h</a>&quot;</span></div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#define TEST_ASSERT(Expr)                       if (!(Expr)) { printf(&quot;%s:%u: assertion failure\n&quot;</span>, __FUNCTION__, __LINE__); while (1) ;}</div>
<div class="line"><span class="preprocessor">#define TEST_ASSERT_EQUAL(expected, actual)     if ((expected) != (actual)) {printf(&quot;%s:%u: assertion failure\n&quot;</span>, __FUNCTION__, __LINE__); while (1) ;}</div>
<div class="line"><span class="preprocessor">#define TEST_ASSERT_NOT_EQUAL(expected, actual) if ((expected) == (actual)) {printf(&quot;%s:%u: assertion failure\n&quot;</span>, __FUNCTION__, __LINE__); while (1) ;}</div>
<div class="line"> </div>
<div class="line"><span class="comment">// forward declarations</span></div>
<div class="line"><span class="keywordtype">void</span> callbackHandler(int32_t status, <a class="code hl_enumeration" href="group__storage__interface__gr.html#ga3a9277f89946d61c41b22da72e3eef7c">ARM_STORAGE_OPERATION</a> operation);</div>
<div class="line"><span class="keywordtype">void</span> progressStateMachine(<span class="keywordtype">void</span>);</div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keyword">enum</span> {</div>
<div class="line">    NEEDS_INITIALIZATION,</div>
<div class="line">    NEEDS_ERASE,</div>
<div class="line">    NEEDS_PROGRAMMING,</div>
<div class="line">    NEEDS_READ,</div>
<div class="line">    NEEDS_VERIFICATION_FOLLOWING_READ,</div>
<div class="line">    FINISHED</div>
<div class="line">} state;</div>
<div class="line"> </div>
<div class="line"><span class="keyword">extern</span> <a class="code hl_struct" href="group__storage__interface__gr.html#structARM__DRIVER__STORAGE">ARM_DRIVER_STORAGE</a> <a class="code hl_define" href="Driver__Storage_8h.html#af4ce245f055ef69edd1306ef8fde37cf">ARM_Driver_Storage_</a>(0);</div>
<div class="line"><a class="code hl_struct" href="group__storage__interface__gr.html#structARM__DRIVER__STORAGE">ARM_DRIVER_STORAGE</a> *drv = &amp;<a class="code hl_define" href="Driver__Storage_8h.html#af4ce245f055ef69edd1306ef8fde37cf">ARM_Driver_Storage_</a>(0);</div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> BUFFER_SIZE = 16384;</div>
<div class="line"><span class="keyword">static</span> uint8_t buffer[BUFFER_SIZE];</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> main(<span class="keywordtype">int</span> argc __unused, <span class="keywordtype">char</span>** argv __unused)</div>
<div class="line">{</div>
<div class="line">    state = NEEDS_INITIALIZATION;</div>
<div class="line"> </div>
<div class="line">    progressStateMachine();</div>
<div class="line">    <span class="keywordflow">while</span> (<span class="keyword">true</span>) {</div>
<div class="line">        <span class="comment">// WFE(); // optional low-power sleep</span></div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> progressStateMachine(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    int32_t rc;</div>
<div class="line"> </div>
<div class="line">    <span class="keyword">static</span> <a class="code hl_struct" href="group__storage__interface__gr.html#structARM__STORAGE__BLOCK">ARM_STORAGE_BLOCK</a> firstBlock;</div>
<div class="line">    <span class="keywordflow">if</span> (!<a class="code hl_define" href="Driver__Storage_8h.html#a955b1ca2ea24cfd3a8923731b581cfd4">ARM_STORAGE_VALID_BLOCK</a>(&amp;firstBlock)) {</div>
<div class="line">        <span class="comment">// Get the first block. This block is entered only once.</span></div>
<div class="line">        rc = drv-&gt;<a class="code hl_variable" href="group__storage__interface__gr.html#a4ced44f1c827e05343481c4e56334a2b">GetNextBlock</a>(NULL, &amp;firstBlock); <span class="comment">// get first block</span></div>
<div class="line">        TEST_ASSERT_EQUAL(<a class="code hl_define" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>, rc);</div>
<div class="line">    }</div>
<div class="line">    TEST_ASSERT(<a class="code hl_define" href="Driver__Storage_8h.html#a955b1ca2ea24cfd3a8923731b581cfd4">ARM_STORAGE_VALID_BLOCK</a>(&amp;firstBlock));</div>
<div class="line">    TEST_ASSERT(firstBlock.<a class="code hl_variable" href="group__storage__interface__gr.html#af931a8871310b4dad23f0f0b0f623560">size</a> &gt; 0);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">switch</span> (state) {</div>
<div class="line">        <span class="keywordflow">case</span> NEEDS_INITIALIZATION:</div>
<div class="line">            rc = drv-&gt;<a class="code hl_variable" href="group__storage__interface__gr.html#a5b5455a05b9291a17e9f2c0b3d2736ef">Initialize</a>(callbackHandler);</div>
<div class="line">            TEST_ASSERT(rc &gt;= <a class="code hl_define" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>);</div>
<div class="line">            <span class="keywordflow">if</span> (rc == <a class="code hl_define" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) {</div>
<div class="line">                TEST_ASSERT_EQUAL(1, drv-&gt;<a class="code hl_variable" href="group__storage__interface__gr.html#ab3064f39b3c42cd63367312505328f29">GetCapabilities</a>().<a class="code hl_variable" href="group__storage__interface__gr.html#a15ade4ca762bc6ce72d435a16febb4cc">asynchronous_ops</a>);</div>
<div class="line">                state = NEEDS_ERASE;</div>
<div class="line">                <span class="keywordflow">return</span>; <span class="comment">// there is pending asynchronous activity which will lead to a completion callback later.</span></div>
<div class="line">            }</div>
<div class="line">            TEST_ASSERT_EQUAL(1, rc); <span class="comment">// synchronous completion</span></div>
<div class="line"> </div>
<div class="line">            <span class="comment">// intentional fall-through</span></div>
<div class="line"> </div>
<div class="line">        <span class="keywordflow">case</span> NEEDS_ERASE:</div>
<div class="line">            TEST_ASSERT(firstBlock.<a class="code hl_variable" href="group__storage__interface__gr.html#ade62c905888479b4f6d078d45cec5830">attributes</a>.<a class="code hl_variable" href="group__storage__interface__gr.html#aac21d3f798c9fcad415b99cf4157935a">erase_unit</a> &gt; 0);</div>
<div class="line">            rc = drv-&gt;<a class="code hl_variable" href="group__storage__interface__gr.html#a009c6f0bb746592a53ddcfd562a559b0">Erase</a>(firstBlock.<a class="code hl_variable" href="group__storage__interface__gr.html#a0e89cf6b9f6cd3125470b1bed2b823df">addr</a>, firstBlock.<a class="code hl_variable" href="group__storage__interface__gr.html#ade62c905888479b4f6d078d45cec5830">attributes</a>.<a class="code hl_variable" href="group__storage__interface__gr.html#aac21d3f798c9fcad415b99cf4157935a">erase_unit</a>);</div>
<div class="line">            TEST_ASSERT(rc &gt;= <a class="code hl_define" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>);</div>
<div class="line">            <span class="keywordflow">if</span> (rc == <a class="code hl_define" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) {</div>
<div class="line">                TEST_ASSERT_EQUAL(1, drv-&gt;<a class="code hl_variable" href="group__storage__interface__gr.html#ab3064f39b3c42cd63367312505328f29">GetCapabilities</a>().<a class="code hl_variable" href="group__storage__interface__gr.html#a15ade4ca762bc6ce72d435a16febb4cc">asynchronous_ops</a>);</div>
<div class="line">                state = NEEDS_PROGRAMMING;</div>
<div class="line">                <span class="keywordflow">return</span>; <span class="comment">// there is pending asynchronous activity which will lead to a completion callback later.</span></div>
<div class="line">            }</div>
<div class="line">            TEST_ASSERT_EQUAL(firstBlock.<a class="code hl_variable" href="group__storage__interface__gr.html#ade62c905888479b4f6d078d45cec5830">attributes</a>.<a class="code hl_variable" href="group__storage__interface__gr.html#aac21d3f798c9fcad415b99cf4157935a">erase_unit</a>, (uint32_t)rc); <span class="comment">// synchronous completion</span></div>
<div class="line"> </div>
<div class="line">            <span class="comment">// intentional fall-through</span></div>
<div class="line"> </div>
<div class="line">        <span class="keywordflow">case</span> NEEDS_PROGRAMMING:</div>
<div class="line">            TEST_ASSERT(BUFFER_SIZE &gt;= firstBlock.<a class="code hl_variable" href="group__storage__interface__gr.html#ade62c905888479b4f6d078d45cec5830">attributes</a>.<a class="code hl_variable" href="group__storage__interface__gr.html#aac21d3f798c9fcad415b99cf4157935a">erase_unit</a>);</div>
<div class="line"><span class="preprocessor">            #define PATTERN 0xAA</span></div>
<div class="line">            memset(buffer, PATTERN, firstBlock.<a class="code hl_variable" href="group__storage__interface__gr.html#ade62c905888479b4f6d078d45cec5830">attributes</a>.<a class="code hl_variable" href="group__storage__interface__gr.html#aac21d3f798c9fcad415b99cf4157935a">erase_unit</a>);</div>
<div class="line">            rc = drv-&gt;<a class="code hl_variable" href="group__storage__interface__gr.html#a2055be24b59b4a6158761eff33a561c1">ProgramData</a>(firstBlock.<a class="code hl_variable" href="group__storage__interface__gr.html#a0e89cf6b9f6cd3125470b1bed2b823df">addr</a>, buffer, firstBlock.<a class="code hl_variable" href="group__storage__interface__gr.html#ade62c905888479b4f6d078d45cec5830">attributes</a>.<a class="code hl_variable" href="group__storage__interface__gr.html#aac21d3f798c9fcad415b99cf4157935a">erase_unit</a>);</div>
<div class="line">            TEST_ASSERT(rc &gt;= <a class="code hl_define" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>);</div>
<div class="line">            <span class="keywordflow">if</span> (rc == <a class="code hl_define" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) {</div>
<div class="line">                TEST_ASSERT_EQUAL(1, drv-&gt;<a class="code hl_variable" href="group__storage__interface__gr.html#ab3064f39b3c42cd63367312505328f29">GetCapabilities</a>().<a class="code hl_variable" href="group__storage__interface__gr.html#a15ade4ca762bc6ce72d435a16febb4cc">asynchronous_ops</a>);</div>
<div class="line">                state = NEEDS_READ;</div>
<div class="line">                <span class="keywordflow">return</span>;  <span class="comment">// there is pending asynchronous activity which will lead to a completion callback later.</span></div>
<div class="line">            }</div>
<div class="line">            TEST_ASSERT_EQUAL(firstBlock.<a class="code hl_variable" href="group__storage__interface__gr.html#ade62c905888479b4f6d078d45cec5830">attributes</a>.<a class="code hl_variable" href="group__storage__interface__gr.html#aac21d3f798c9fcad415b99cf4157935a">erase_unit</a>, (uint32_t)rc); <span class="comment">// synchronous completion</span></div>
<div class="line"> </div>
<div class="line">            <span class="comment">// intentional fall-through</span></div>
<div class="line"> </div>
<div class="line">        <span class="keywordflow">case</span> NEEDS_READ:</div>
<div class="line">            rc = drv-&gt;<a class="code hl_variable" href="group__storage__interface__gr.html#aac7475b53f1356448c7312c39aa61026">ReadData</a>(firstBlock.<a class="code hl_variable" href="group__storage__interface__gr.html#a0e89cf6b9f6cd3125470b1bed2b823df">addr</a>, buffer, firstBlock.<a class="code hl_variable" href="group__storage__interface__gr.html#ade62c905888479b4f6d078d45cec5830">attributes</a>.<a class="code hl_variable" href="group__storage__interface__gr.html#aac21d3f798c9fcad415b99cf4157935a">erase_unit</a>);</div>
<div class="line">            TEST_ASSERT(rc &gt;= <a class="code hl_define" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>);</div>
<div class="line">            <span class="keywordflow">if</span> (rc == <a class="code hl_define" href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a>) {</div>
<div class="line">                TEST_ASSERT_EQUAL(1, drv-&gt;<a class="code hl_variable" href="group__storage__interface__gr.html#ab3064f39b3c42cd63367312505328f29">GetCapabilities</a>().<a class="code hl_variable" href="group__storage__interface__gr.html#a15ade4ca762bc6ce72d435a16febb4cc">asynchronous_ops</a>);</div>
<div class="line">                state = NEEDS_VERIFICATION_FOLLOWING_READ;</div>
<div class="line">                <span class="keywordflow">return</span>;  <span class="comment">// there is pending asynchronous activity which will lead to a completion callback later.</span></div>
<div class="line">            }</div>
<div class="line">            TEST_ASSERT_EQUAL(firstBlock.<a class="code hl_variable" href="group__storage__interface__gr.html#ade62c905888479b4f6d078d45cec5830">attributes</a>.<a class="code hl_variable" href="group__storage__interface__gr.html#aac21d3f798c9fcad415b99cf4157935a">erase_unit</a>, (uint32_t)rc);</div>
<div class="line"> </div>
<div class="line">            <span class="comment">// intentional fall-through</span></div>
<div class="line"> </div>
<div class="line">        <span class="keywordflow">case</span> NEEDS_VERIFICATION_FOLLOWING_READ:</div>
<div class="line">            printf(<span class="stringliteral">&quot;verifying data\r\n&quot;</span>);</div>
<div class="line">            <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> i = 0; i &lt; firstBlock.<a class="code hl_variable" href="group__storage__interface__gr.html#ade62c905888479b4f6d078d45cec5830">attributes</a>.<a class="code hl_variable" href="group__storage__interface__gr.html#aac21d3f798c9fcad415b99cf4157935a">erase_unit</a>; i++) {</div>
<div class="line">                TEST_ASSERT_EQUAL(PATTERN, buffer[i]);</div>
<div class="line">            }</div>
<div class="line">            state = FINISHED;</div>
<div class="line">            printf(<span class="stringliteral">&quot;done\r\n&quot;</span>);</div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line"> </div>
<div class="line">        <span class="keywordflow">case</span> FINISHED:</div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">    } <span class="comment">// switch (state)</span></div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> callbackHandler(int32_t status, <a class="code hl_enumeration" href="group__storage__interface__gr.html#ga3a9277f89946d61c41b22da72e3eef7c">ARM_STORAGE_OPERATION</a> operation)</div>
<div class="line">{</div>
<div class="line">    (void)status;</div>
<div class="line">    (void)operation;</div>
<div class="line">    <span class="keywordflow">switch</span> (operation) {</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="Driver__Storage_8h.html#ga3a9277f89946d61c41b22da72e3eef7caca3985b874bf393dc2e448b339668971">ARM_STORAGE_OPERATION_INITIALIZE</a>:</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="Driver__Storage_8h.html#ga3a9277f89946d61c41b22da72e3eef7ca177812f3cb27c413473d94ebe9480454">ARM_STORAGE_OPERATION_READ_DATA</a>:</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="Driver__Storage_8h.html#ga3a9277f89946d61c41b22da72e3eef7ca586b4774a7a092d1932d3415cc42abb0">ARM_STORAGE_OPERATION_PROGRAM_DATA</a>:</div>
<div class="line">        <span class="keywordflow">case</span> <a class="code hl_enumvalue" href="Driver__Storage_8h.html#ga3a9277f89946d61c41b22da72e3eef7cab52a1d10b8087452fd97af8cdb9a6f75">ARM_STORAGE_OPERATION_ERASE</a>:</div>
<div class="line">            progressStateMachine();</div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line"> </div>
<div class="line">        <span class="keywordflow">default</span>:</div>
<div class="line">            printf(<span class="stringliteral">&quot;callbackHandler: unexpected callback for opcode %u with status %ld\r\n&quot;</span>, operation, status);</div>
<div class="line">            <span class="keywordflow">break</span>;</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="ttc" id="aDriver__Storage_8h_html"><div class="ttname"><a href="Driver__Storage_8h.html">Driver_Storage.h</a></div></div>
<div class="ttc" id="aDriver__Storage_8h_html_a955b1ca2ea24cfd3a8923731b581cfd4"><div class="ttname"><a href="Driver__Storage_8h.html#a955b1ca2ea24cfd3a8923731b581cfd4">ARM_STORAGE_VALID_BLOCK</a></div><div class="ttdeci">#define ARM_STORAGE_VALID_BLOCK(BLK)</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:100</div></div>
<div class="ttc" id="aDriver__Storage_8h_html_af4ce245f055ef69edd1306ef8fde37cf"><div class="ttname"><a href="Driver__Storage_8h.html#af4ce245f055ef69edd1306ef8fde37cf">ARM_Driver_Storage_</a></div><div class="ttdeci">#define ARM_Driver_Storage_(n)</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:46</div></div>
<div class="ttc" id="aDriver__Storage_8h_html_ga3a9277f89946d61c41b22da72e3eef7ca177812f3cb27c413473d94ebe9480454"><div class="ttname"><a href="Driver__Storage_8h.html#ga3a9277f89946d61c41b22da72e3eef7ca177812f3cb27c413473d94ebe9480454">ARM_STORAGE_OPERATION_READ_DATA</a></div><div class="ttdeci">@ ARM_STORAGE_OPERATION_READ_DATA</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:210</div></div>
<div class="ttc" id="aDriver__Storage_8h_html_ga3a9277f89946d61c41b22da72e3eef7ca586b4774a7a092d1932d3415cc42abb0"><div class="ttname"><a href="Driver__Storage_8h.html#ga3a9277f89946d61c41b22da72e3eef7ca586b4774a7a092d1932d3415cc42abb0">ARM_STORAGE_OPERATION_PROGRAM_DATA</a></div><div class="ttdeci">@ ARM_STORAGE_OPERATION_PROGRAM_DATA</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:211</div></div>
<div class="ttc" id="aDriver__Storage_8h_html_ga3a9277f89946d61c41b22da72e3eef7cab52a1d10b8087452fd97af8cdb9a6f75"><div class="ttname"><a href="Driver__Storage_8h.html#ga3a9277f89946d61c41b22da72e3eef7cab52a1d10b8087452fd97af8cdb9a6f75">ARM_STORAGE_OPERATION_ERASE</a></div><div class="ttdeci">@ ARM_STORAGE_OPERATION_ERASE</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:212</div></div>
<div class="ttc" id="aDriver__Storage_8h_html_ga3a9277f89946d61c41b22da72e3eef7caca3985b874bf393dc2e448b339668971"><div class="ttname"><a href="Driver__Storage_8h.html#ga3a9277f89946d61c41b22da72e3eef7caca3985b874bf393dc2e448b339668971">ARM_STORAGE_OPERATION_INITIALIZE</a></div><div class="ttdeci">@ ARM_STORAGE_OPERATION_INITIALIZE</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:207</div></div>
<div class="ttc" id="agroup__execution__status_html_ga85752c5de59e8adeb001e35ff5be6be7"><div class="ttname"><a href="group__execution__status.html#ga85752c5de59e8adeb001e35ff5be6be7">ARM_DRIVER_OK</a></div><div class="ttdeci">#define ARM_DRIVER_OK</div><div class="ttdoc">Operation succeeded.</div></div>
<div class="ttc" id="agroup__storage__interface__gr_html_a009c6f0bb746592a53ddcfd562a559b0"><div class="ttname"><a href="group__storage__interface__gr.html#a009c6f0bb746592a53ddcfd562a559b0">ARM_DRIVER_STORAGE::Erase</a></div><div class="ttdeci">int32_t(* Erase)(uint64_t addr, uint32_t size)</div><div class="ttdoc">Pointer to ARM_Storage_Erase : Erase Storage range.</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:421</div></div>
<div class="ttc" id="agroup__storage__interface__gr_html_a0e89cf6b9f6cd3125470b1bed2b823df"><div class="ttname"><a href="group__storage__interface__gr.html#a0e89cf6b9f6cd3125470b1bed2b823df">ARM_STORAGE_BLOCK::addr</a></div><div class="ttdeci">uint64_t addr</div><div class="ttdoc">This is the start address of the storage block. It is expressed as an offset from the start of the st...</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:89</div></div>
<div class="ttc" id="agroup__storage__interface__gr_html_a15ade4ca762bc6ce72d435a16febb4cc"><div class="ttname"><a href="group__storage__interface__gr.html#a15ade4ca762bc6ce72d435a16febb4cc">ARM_STORAGE_CAPABILITIES::asynchronous_ops</a></div><div class="ttdeci">uint32_t asynchronous_ops</div><div class="ttdoc">Used to indicate if APIs like initialize, read, erase, program, etc. can operate in asynchronous mode...</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:189</div></div>
<div class="ttc" id="agroup__storage__interface__gr_html_a2055be24b59b4a6158761eff33a561c1"><div class="ttname"><a href="group__storage__interface__gr.html#a2055be24b59b4a6158761eff33a561c1">ARM_DRIVER_STORAGE::ProgramData</a></div><div class="ttdeci">int32_t(* ProgramData)(uint64_t addr, const void *data, uint32_t size)</div><div class="ttdoc">Pointer to ARM_Storage_ProgramData : Program data to Storage.</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:420</div></div>
<div class="ttc" id="agroup__storage__interface__gr_html_a4ced44f1c827e05343481c4e56334a2b"><div class="ttname"><a href="group__storage__interface__gr.html#a4ced44f1c827e05343481c4e56334a2b">ARM_DRIVER_STORAGE::GetNextBlock</a></div><div class="ttdeci">int32_t(* GetNextBlock)(const ARM_STORAGE_BLOCK *prev, ARM_STORAGE_BLOCK *next)</div><div class="ttdoc">Pointer to ARM_Storage_GetNextBlock : fetch successor for current block.</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:426</div></div>
<div class="ttc" id="agroup__storage__interface__gr_html_a5b5455a05b9291a17e9f2c0b3d2736ef"><div class="ttname"><a href="group__storage__interface__gr.html#a5b5455a05b9291a17e9f2c0b3d2736ef">ARM_DRIVER_STORAGE::Initialize</a></div><div class="ttdeci">int32_t(* Initialize)(ARM_Storage_Callback_t callback)</div><div class="ttdoc">Pointer to ARM_Storage_Initialize : Initialize the Storage Interface.</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:416</div></div>
<div class="ttc" id="agroup__storage__interface__gr_html_aac21d3f798c9fcad415b99cf4157935a"><div class="ttname"><a href="group__storage__interface__gr.html#aac21d3f798c9fcad415b99cf4157935a">ARM_STORAGE_BLOCK_ATTRIBUTES::erase_unit</a></div><div class="ttdeci">uint32_t erase_unit</div><div class="ttdoc">Minimum erase size in bytes. The offset of the start of the erase-range should also be aligned with t...</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:75</div></div>
<div class="ttc" id="agroup__storage__interface__gr_html_aac7475b53f1356448c7312c39aa61026"><div class="ttname"><a href="group__storage__interface__gr.html#aac7475b53f1356448c7312c39aa61026">ARM_DRIVER_STORAGE::ReadData</a></div><div class="ttdeci">int32_t(* ReadData)(uint64_t addr, void *data, uint32_t size)</div><div class="ttdoc">Pointer to ARM_Storage_ReadData : Read data from Storage.</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:419</div></div>
<div class="ttc" id="agroup__storage__interface__gr_html_ab3064f39b3c42cd63367312505328f29"><div class="ttname"><a href="group__storage__interface__gr.html#ab3064f39b3c42cd63367312505328f29">ARM_DRIVER_STORAGE::GetCapabilities</a></div><div class="ttdeci">ARM_STORAGE_CAPABILITIES(* GetCapabilities)(void)</div><div class="ttdoc">Pointer to ARM_Storage_GetCapabilities : Get driver capabilities.</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:415</div></div>
<div class="ttc" id="agroup__storage__interface__gr_html_ade62c905888479b4f6d078d45cec5830"><div class="ttname"><a href="group__storage__interface__gr.html#ade62c905888479b4f6d078d45cec5830">ARM_STORAGE_BLOCK::attributes</a></div><div class="ttdeci">ARM_STORAGE_BLOCK_ATTRIBUTES attributes</div><div class="ttdoc">Attributes for this block.</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:94</div></div>
<div class="ttc" id="agroup__storage__interface__gr_html_af931a8871310b4dad23f0f0b0f623560"><div class="ttname"><a href="group__storage__interface__gr.html#af931a8871310b4dad23f0f0b0f623560">ARM_STORAGE_BLOCK::size</a></div><div class="ttdeci">uint64_t size</div><div class="ttdoc">This is the size of the storage block, in units of bytes. Together with addr, it describes a range [a...</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:92</div></div>
<div class="ttc" id="agroup__storage__interface__gr_html_ga3a9277f89946d61c41b22da72e3eef7c"><div class="ttname"><a href="group__storage__interface__gr.html#ga3a9277f89946d61c41b22da72e3eef7c">ARM_STORAGE_OPERATION</a></div><div class="ttdeci">ARM_STORAGE_OPERATION</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:204</div></div>
<div class="ttc" id="agroup__storage__interface__gr_html_structARM__DRIVER__STORAGE"><div class="ttname"><a href="group__storage__interface__gr.html#structARM__DRIVER__STORAGE">ARM_DRIVER_STORAGE</a></div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:413</div></div>
<div class="ttc" id="agroup__storage__interface__gr_html_structARM__STORAGE__BLOCK"><div class="ttname"><a href="group__storage__interface__gr.html#structARM__STORAGE__BLOCK">ARM_STORAGE_BLOCK</a></div><div class="ttdoc">A storage block is a range of memory with uniform attributes.</div><div class="ttdef"><b>Definition:</b> Driver_Storage.h:88</div></div>
</div><!-- fragment --> </div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">
      <script type="text/javascript">
        <!--
        writeFooter.call(this);
        //-->
      </script> 
    </li>
  </ul>
</div>
</body>
</html>
